<?php
include ("../../config/config.php");
include ("../include/function.php");
if ($_GET['action']=="start"){
    $redis=Redis_Link();
    $redis->set('Main_Start',"OK");
    $data['code']="201";
    echo json_encode($data);
    exit;
}elseif ($_GET['action']=="stop"){
    $redis=Redis_Link();
    $worker_thread=Get_Config('worker_thread');
    for ($i=1;$i<=$worker_thread;$i++){
        $redis->set("Work_Restart_".$i,"yes");
    }
    $redis->set('Main_Start',"stop");
    $data['code']="201";
    echo json_encode($data);
    exit;
}